import request from '@/utils/request'

export function findPage (data) {
  return request({
    url: '/dept/pageFind',
    method: 'post',
    data
  })
}

export function findDepts () {
  return request({
    url: '/dept/findDepts',
    method: 'get'
  })
}

export function tree () {
  return request({
    url: '/dept/tree',
    method: 'get'
  })
}

export function addDept(data) {
    return request({
        url: '/dept/addDept',
        method: 'post',
        data
    })
}


export function deleteDept(deptId) {
    return request({
        url: `/dept/delete?deptId=${deptId}`,
        method: 'post',

    })
}

export function deleteDepts(data) {
    return request({
        url: `/dept/delete/batch`,
        method: 'post',
        data
    })
}

export function update(data) {
    return request({
        url: `/dept/update`,
        method: 'post',
        data
    })
}


export function updateStatus(deptId) {
    return request({
        url: `/dept/updateStatus?deptId=${deptId}`,
        method: 'post',

    })
}